package com.awardsystem.Service;

import com.awardsystem.Dao.PatentDao;
import com.awardsystem.entity.Achievement;
import com.awardsystem.entity.Patent;
import com.awardsystem.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PatentService {
    @Autowired
    PatentDao patentDao;

    public List<Patent> findAll(){return patentDao.findAll();}
    public List<Patent> findByNameContains(String name){return patentDao.findPatentsByNameContains(name);}
    public Patent findByNameEquals(String name){return patentDao.findPatentsByNameEquals(name);}
    public Patent findById(Integer id){return patentDao.findPatentById(id);}
    public void delete(Patent patent){patentDao.delete(patent);}
    public void save(Patent patent){patentDao.save(patent);}
    public List<Patent> findPatentsByAchievement(Achievement achievement){return patentDao.findPatentsByAchievementsEquals(achievement);}
}
